class Solution {
public:
    string longestCommonPrefix(vector<string>& strs) {
        int pro = 0;
        int des = 0;
        string str;
        while (pro < strs[0].size())
        {
            char New = strs[0][pro];
            for (int i = 0; i < strs.size(); i++)
            {
                if (des >= strs[i].size())
                {
                    return str;
                }
                if (New == strs[i][des])
                {
                    continue;
                }
                else
                {
                    return str;
                }
            }
            str.push_back(New);
            pro++;
            des++;
        }
        return str;
    }
};